package com.ucode.model.hrm.form;

import com.ucode.model.hrm.HrmStudyExperience;
import com.ucode.model.hrm.HrmWorkExperience;
import com.ucode.tool.base.enums.EducationLevelEnum;
import com.ucode.tool.base.enums.MaritalStatusEnum;
import com.ucode.tool.base.enums.PoliticalStatusTypeEnum;
import com.ucode.tool.validator.InEnum;
import com.ucode.tool.validator.Mobile;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.validation.Valid;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDate;
import java.util.List;
import java.util.Set;

@Schema(description = "人力资源管理系统 - 个人简历Form")
@Data
@EqualsAndHashCode
@ToString(callSuper = true)
public class HrmPersonalResumeForm {

    /**
     * 头像
     */
    @Schema(description = "头像", requiredMode = Schema.RequiredMode.AUTO)
    @Size(max = 256, message = "头像不能超过 256 个字符")
    private String avatar;

    /**
     * 姓名
     */
    @Schema(description = "真实姓名", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "真实姓名不能为空")
    @Size(max = 50, message = "真实姓名不能超过 50 个字符")
    private String name;
    /**
     * 性别
     * @see com.ucode.tool.base.enums.SexEnum
     */
    @Schema(description = "性别", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "性别不能为空")
    @InEnum(value= com.ucode.tool.base.enums.SexEnum.class)
    private Integer gender;
    /**
     * 电话
     */
    @Schema(description = "电话", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "电话不能为空")
    @Mobile
    @Size(max = 20, message = "电话不能超过 20 个字符")
    private String phone;
    /**
     * 电子邮箱
     */
    @Schema(description = "电子邮箱", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "电子邮箱不能为空")
    @Email
    @Size(max = 50, message = "电子邮箱不能超过 50 个字符")
    private String email;
    /**
     * 民族
     */
    @Schema(description = "民族", requiredMode = Schema.RequiredMode.AUTO)
    private String ethnicity;
    /**
     * 出生日期
     */
    @Schema(description = "出生日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "出生日期不能为空")
    private LocalDate birthDate;
    /**
     * 婚姻状态
     * @see com.ucode.tool.base.enums.MaritalStatusEnum
     */
    @Schema(description = "婚姻状况", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "婚姻状况不能为空")
    @InEnum(value= MaritalStatusEnum.class)
    private Integer maritalStatus;
    /**
     * 政治面貌
     * @see com.ucode.tool.base.enums.PoliticalStatusTypeEnum
     */
    @Schema(description = "政治面貌", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "政治面貌不能为空")
    @InEnum(value= PoliticalStatusTypeEnum.class)
    private Integer politicalStatus;
    /**
     * 学历
     * @see EducationLevelEnum
     */
    @Schema(description = "学历", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "学历不能为空")
    @InEnum(value= EducationLevelEnum.class)
    private Integer education;
    /**
     * 专业学科
     */
    @Schema(description = "专业学科", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "专业学科不能为空")
    @Size(max = 100, message = "专业学科不能超过 100 个字符")
    private String specialty;
    /**
     * 证书
     */
    @Schema(description = "证书", requiredMode = Schema.RequiredMode.AUTO)
    @Size(max = 100, message = "证书不能超过 100 个字符")
    private String certificate;
    /**
     * 附件路径
     */
    @Schema(description = "简历附件", requiredMode = Schema.RequiredMode.AUTO)
    @Size(max = 255, message = "简历附件不能超过 255 个字符")
    private String fileUrl;
    /**
     * 技能标签
     */
    @Schema(description = "技能标签", requiredMode = Schema.RequiredMode.AUTO)
    private Set<String> skillsTags;
    /**
     * 自我介绍
     */
    @Schema(description = "自我介绍", requiredMode = Schema.RequiredMode.AUTO)
    @Size(max = 255, message = "自我介绍不能超过 255 个字符")
    private String selfIntro;

    //教育经历
    @Schema(description = "教育经历", requiredMode = Schema.RequiredMode.AUTO)
    private List<@Valid HrmStudyExperience> studyExperiences;
    //工作经历
    @Schema(description = "工作经历", requiredMode = Schema.RequiredMode.AUTO)
    private List<@Valid HrmWorkExperience> workExperiences;

}
